package com.atguigu.daijia.order.service;

import com.atguigu.daijia.model.entity.order.OrderInfo;
import com.atguigu.daijia.model.form.order.OrderInfoForm;
import com.atguigu.daijia.model.form.order.StartDriveForm;
import com.atguigu.daijia.model.form.order.UpdateOrderBillForm;
import com.atguigu.daijia.model.form.order.UpdateOrderCartForm;
import com.atguigu.daijia.model.vo.base.PageVo;
import com.atguigu.daijia.model.vo.order.CurrentOrderInfoVo;
import com.atguigu.daijia.model.vo.order.OrderBillVo;
import com.atguigu.daijia.model.vo.order.OrderPayVo;
import com.atguigu.daijia.model.vo.order.OrderProfitsharingVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

public interface OrderInfoService extends IService<OrderInfo> {

    Long saveOrderInfo(OrderInfoForm orderInfoForm);

    //根据订单Id获取订单的状态
    Integer getOrderStatus(Long orderId);

    //司机抢单
    Boolean robNewOrder(Long driverId, Long orderId);

    //乘客端查找当前订单
    CurrentOrderInfoVo searchCustomerCurrentOrder(Long customerId);

    //司机端查找当前订单
    CurrentOrderInfoVo searchDriverCurrentOrder(Long driverId);

    //司机到达起始点,更新订单信息
    Boolean driverArriveStartLocation(Long orderId, Long driverId);

    //司机到达起始点,更新代驾车辆信息
    Boolean updateOrderCart(UpdateOrderCartForm updateOrderCartForm);

    //司机开始代驾服务，更新订单状态
    Boolean startDrive(StartDriveForm startDriveForm);

    //根据时间段获取订单数
    Long getOrderNumByTime(String startTime, String endTime);

    //结束代驾服务更新订单账单信息
    Boolean endDrive(UpdateOrderBillForm updateOrderBillForm);

    //获取乘客订单分页列表
    PageVo findCustomerOrderPage(Page<OrderInfo> pageParam, Long customerId);

    //获取司机订单分页列表
    PageVo findDriverOrderPage(Page<OrderInfo> pageParam, Long driverId);

    //根据订单id获取实际账单信息
    OrderBillVo getOrderBillInfo(Long orderId);

    //根据订单id获取实际分账信息
    OrderProfitsharingVo getOrderProfitsharing(Long orderId);

    //司机发送账单信息,实际就是更新订单的状态
    Boolean sendOrderBillInfo(Long orderId, Long driverId);

    //获取订单支付信息
    OrderPayVo getOrderPayVo(String orderNo, Long customerId);
}
